<template>
  <div class="el-main">
    <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
      <el-tab-pane label="项目数据" name="project">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addProjectFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportProjectExcel">导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change="handleSelectionChange"
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="项目ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="project_name"
            label="项目名称"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="project_number"
            label="项目编号"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="rouge"
            label="可见范围"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="description"
            label="描述"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="member_id"
            label="成员ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="state"
            label="项目状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="state_description"
            label="状态描述"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="customer_unit"
            label="客户单位"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="customer_representative"
            label="客户代表"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="project_type"
            label="项目类型"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="start_date"
            label="开始时间"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="over_date"
            label="结束时间"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="top_state"
            label="置顶装填"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="delete_state"
            label="删除状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="principal_id"
            label="负责人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="creator_id"
            label="创建人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="create_date"
            label="创建时间"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="企业ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="deleter_id"
            label="删除人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="delete_date"
            label="删除日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
      <el-tab-pane label="任务数据" name="mission">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addMissionFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportMissionExcel">导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change=""
          @select=""
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="status"
            label="任务状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="title"
            label="任务标题"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="project_id"
            label="项目ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="creator_id"
            label="创建人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="create_date"
            label="创建日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="type"
            label="类型"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="principal_id"
            label="负责人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="participant_id"
            label="参与人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="priority"
            label="优先级"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="start_date"
            label="开始日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="over_date"
            label="结束日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="description"
            label="描述"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="before_id"
            label="前置任务"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="after_id"
            label="后置任务"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="delete_state"
            label="删除状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="公司ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
      <el-tab-pane label="项目任务数据" name="projectMission">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addMissionProjectFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportMissionProjectExcel">导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change=""
          @select=""
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="项目任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="mission_id"
            label="任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="PM_state"
            label="任务状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="father_id"
            label="父级任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="prospect_hour"
            label="当前任务工时预估"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="hour"
            label="当前任务工时登记"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="公司ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="rel_mission_id"
            label="REL任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
      <el-tab-pane label="目标数据" name="target">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addTargetFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportTargetExcel">导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change=""
          @select=""
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="序号"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="mission_id"
            label="任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="unit"
            label="量化指标-单位"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="initial_value"
            label="量化指标-起始值"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="target_value"
            label="量化指标-目标值"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="current_value"
            label="量化指标-当前值"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="standard"
            label="验收标准"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="Texplain"
            label="交付说明"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="feedback"
            label="验收反馈"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="target_status"
            label="目标状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="公司ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
      <el-tab-pane label="费用数据" name="cost">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addCostFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportCostExcel">导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change=""
          @select=""
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="费用ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="mission_id"
            label="所属任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="information"
            label="付款信息"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="project_id"
            label="项目ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="payment_date"
            label="付款日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="finance"
            label="财务科目"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="budget"
            label="预算金额"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="execute"
            label="执行金额"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="cost_state"
            label="费用状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="happen_date"
            label="发生日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="公司ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
      <el-tab-pane label="审批数据" name="examine">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addExamineFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportExamineExcel">导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change=""
          @select=""
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="审批ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="state"
            label="审批状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="number"
            label="审批编号"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="content"
            label="申请内容"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="detail"
            label="审批详情"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="applicant_id"
            label="申请人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="type"
            label="审批类型"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="公司ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
      <el-tab-pane label="工时数据" name="time">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addTimeFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportTimeExcel">导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change=""
          @select=""
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="序号"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="registrant_id"
            label="登记人ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="work_date"
            label="工作日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="hour"
            label="工时"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="work_type"
            label="工时类别"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="description"
            label="描述"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="公司ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="mission_id"
            label="任务ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
      <el-tab-pane label="审批流程数据" name="examineProcess">
        <el-upload
          class="avatar-uploader"
          action="#"
          :show-file-list="false"
          style="float: right;margin-right:10px;"
          :http-request="addExamineProcessFile"
          multiple>
          <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px">导入数据</el-button>
        </el-upload>

        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="exportExamineProcessExcel">
          导出数据
        </el-button>
        <el-button style="float: right;margin-top: -10px; margin-right: 20px; margin-bottom: 10px"
                   @click="delMultipleById">批量删除
        </el-button>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%; min-width: 500px;"
          @selection-change=""
          @select=""
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            type="selection"
            style="width:20%">
          </el-table-column>
          <el-table-column
            prop="id"
            label="序号"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="examine_id"
            label="审批ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="examine_p_id"
            label="审批人Id"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="state"
            label="审批状态"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="next_p_id"
            label="下一个审批人"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="date"
            label="审批日期"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="enterprise_id"
            label="公司ID"
            style="width:20%"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
              <el-button @click="delrow(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          @current-change="handleCurrentChange"
          layout="prev, pager, next"
          :total="this.totalNum">
        </el-pagination>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
const axios = require('axios');
export default {
  name: "Role",
  data() {
    return {
      activeName: 'project',
      tableData: [],
      totalData: [],
      multipleSelection: [],
      totalNum: 0,
      nowtablename: 'project',
      temp: {},
    };
  },
  methods: {
    delMultipleById() {
      console.log(this.multipleSelection)
      let idlist = []
      this.multipleSelection.forEach(selection => {
        idlist.push(selection.id)
      })
      axios.post('/deleteByIdList',
        {"idlist": idlist, "tablename":this.nowtablename}).then(res => {
          this.$message.info("删除成功")
        this.$router.go(0)
      });
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    delrow(data) {
      console.log(this.nowtablename)
      switch (this.nowtablename) {
        case "project":
          this.$loading(true)
          axios.post('/deleteProjectById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        case "mission":
          this.$loading(true)
          axios.post('/deleteMissionById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        case "projectMission":
          this.$loading(true)
          axios.post('/deleteMissionProjectById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        case "target":
          this.$loading(true)
          axios.post('/deleteTargetById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        case "examine":
          this.$loading(true)
          axios.post('/deleteExamineById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        case "cost":
          this.$loading(true)
          axios.post('/deleteCostById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        case "time":
          this.$loading(true)
          axios.post('/deleteHourById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        case "examineProcess":
          this.$loading(true)
          axios.post('/deleteExamineProcessById',
            {"id": data.id}).then(res => {
            for (let i in this.tableData) {
              if (this.tableData[i] === data) {
                this.tableData.splice(i, 1)
              }
            }
          });
          this.$loading().close()
          break;
        default:
          break;
      }
    },
    handleCurrentChange(val) {
      this.tableData = this.totalData.slice((val - 1) * 10, val * 10)
    },
    handleClick(tab) {
      this.temp = tab
      console.log(tab.paneName);
      this.nowtablename = tab.paneName
      switch (tab.paneName) {
        case "project":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleProjectMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            // console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            console.log(res.data.length)
            this.totalNum = res.data.length
            // this.totalNum = res.data
          });
          console.log(this.totalNum)
          this.$loading().close()
          break;
        case "mission":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleMissionMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            this.totalNum = res.data.length
          });

          this.$loading().close()
          break;
        case "projectMission":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleMissionProjectMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            this.totalNum = res.data.length
          });

          this.$loading().close()
          break;
        case "target":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleTargetMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            this.totalNum = res.data.length
          });

          this.$loading().close()
          break;
        case "examine":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleExamineMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            this.totalNum = res.data.length
          });

          this.$loading().close()
          break;
        case "cost":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleCostMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            this.totalNum = res.data.length
          });

          this.$loading().close()
          break;
        case "time":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleHourMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            this.totalNum = res.data.length
          });

          this.$loading().close()
          break;
        case "examineProcess":
          this.$loading(true)
          this.tableData = []
          axios.post('/getConsoleExaminProcessMessage',
            {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
            console.log(res.data)
            this.totalData = res.data
            this.tableData = this.totalData.slice(0, 10)
            this.totalNum = res.data.length
          });

          this.$loading().close()
          break;
        default:
          break;
      }
      this.activeName = tab.paneName
    },
    addProjectFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleProjectExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        // if (res.data.success == true) {
        //   axios.post('/createTimeFile', {
        //     "fileName": res.data.message,
        //     "url":res.data.fileAddress,
        //     "size":res.data.size,
        //     "userId": window.localStorage.getItem("id"),
        //     "missionId":this.missionsDetail.number,
        //     "enterpriseId":window.localStorage.getItem("enterprise_id")
        //   }).then(res => {
        //     if (res.data == 1) {
        //       this.$notify({
        //         title: '成功',
        //         message: '上传成功',
        //         type: 'success'
        //       });
        //     } else {
        //       this.$notify.error({
        //         title: '失败',
        //         message: '上传失败',
        //       });
        //     }
        //   })
        // }
      })
    },
    exportProjectExcel() {
      axios.post('/getConsoleProjectExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    addMissionFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleMissionExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        // if (res.data.success == true) {
        //   axios.post('/createTimeFile', {
        //     "fileName": res.data.message,
        //     "url":res.data.fileAddress,
        //     "size":res.data.size,
        //     "userId": window.localStorage.getItem("id"),
        //     "missionId":this.missionsDetail.number,
        //     "enterpriseId":window.localStorage.getItem("enterprise_id")
        //   }).then(res => {
        //     if (res.data == 1) {
        //       this.$notify({
        //         title: '成功',
        //         message: '上传成功',
        //         type: 'success'
        //       });
        //     } else {
        //       this.$notify.error({
        //         title: '失败',
        //         message: '上传失败',
        //       });
        //     }
        //   })
        // }
      })
    },
    exportMissionExcel() {
      axios.post('/getConsoleMissionExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    addMissionProjectFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleMissionProjectExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        // if (res.data.success == true) {
        //   axios.post('/createTimeFile', {
        //     "fileName": res.data.message,
        //     "url":res.data.fileAddress,
        //     "size":res.data.size,
        //     "userId": window.localStorage.getItem("id"),
        //     "missionId":this.missionsDetail.number,
        //     "enterpriseId":window.localStorage.getItem("enterprise_id")
        //   }).then(res => {
        //     if (res.data == 1) {
        //       this.$notify({
        //         title: '成功',
        //         message: '上传成功',
        //         type: 'success'
        //       });
        //     } else {
        //       this.$notify.error({
        //         title: '失败',
        //         message: '上传失败',
        //       });
        //     }
        //   })
        // }
      })
    },
    exportMissionProjectExcel() {
      axios.post('/getConsoleMissionProjectExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    addTargetFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleTargetExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        // if (res.data.success == true) {
        //   axios.post('/createTimeFile', {
        //     "fileName": res.data.message,
        //     "url":res.data.fileAddress,
        //     "size":res.data.size,
        //     "userId": window.localStorage.getItem("id"),
        //     "missionId":this.missionsDetail.number,
        //     "enterpriseId":window.localStorage.getItem("enterprise_id")
        //   }).then(res => {
        //     if (res.data == 1) {
        //       this.$notify({
        //         title: '成功',
        //         message: '上传成功',
        //         type: 'success'
        //       });
        //     } else {
        //       this.$notify.error({
        //         title: '失败',
        //         message: '上传失败',
        //       });
        //     }
        //   })
        // }
      })
    },
    exportTargetExcel() {
      axios.post('/getConsoleTargetExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    addCostFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleCostExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        // if (res.data.success == true) {
        //   axios.post('/createTimeFile', {
        //     "fileName": res.data.message,
        //     "url":res.data.fileAddress,
        //     "size":res.data.size,
        //     "userId": window.localStorage.getItem("id"),
        //     "missionId":this.missionsDetail.number,
        //     "enterpriseId":window.localStorage.getItem("enterprise_id")
        //   }).then(res => {
        //     if (res.data == 1) {
        //       this.$notify({
        //         title: '成功',
        //         message: '上传成功',
        //         type: 'success'
        //       });
        //     } else {
        //       this.$notify.error({
        //         title: '失败',
        //         message: '上传失败',
        //       });
        //     }
        //   })
        // }
      })
    },
    exportCostExcel() {
      axios.post('/getConsoleCostExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    exportExamineExcel() {
      axios.post('/getConsoleExamineExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    addExamineFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleExamineExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        // if (res.data.success == true) {
        //   axios.post('/createTimeFile', {
        //     "fileName": res.data.message,
        //     "url":res.data.fileAddress,
        //     "size":res.data.size,
        //     "userId": window.localStorage.getItem("id"),
        //     "missionId":this.missionsDetail.number,
        //     "enterpriseId":window.localStorage.getItem("enterprise_id")
        //   }).then(res => {
        //     if (res.data == 1) {
        //       this.$notify({
        //         title: '成功',
        //         message: '上传成功',
        //         type: 'success'
        //       });
        //     } else {
        //       this.$notify.error({
        //         title: '失败',
        //         message: '上传失败',
        //       });
        //     }
        //   })
        // }
      })
    },
    exportTimeExcel() {
      axios.post('/getConsoleTimeExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    exportExamineProcessExcel() {
      axios.post('/getConsoleExcel', {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
        console.log(res);
        location.href = res.data.url;
      });
    },
    addTimeFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleTimeExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        // if (res.data.success == true) {
        //   axios.post('/createTimeFile', {
        //     "fileName": res.data.message,
        //     "url":res.data.fileAddress,
        //     "size":res.data.size,
        //     "userId": window.localStorage.getItem("id"),
        //     "missionId":this.missionsDetail.number,
        //     "enterpriseId":window.localStorage.getItem("enterprise_id")
        //   }).then(res => {
        //     if (res.data == 1) {
        //       this.$notify({
        //         title: '成功',
        //         message: '上传成功',
        //         type: 'success'
        //       });
        //     } else {
        //       this.$notify.error({
        //         title: '失败',
        //         message: '上传失败',
        //       });
        //     }
        //   })
        // }
      })
    },
    addExamineProcessFile(f) {
      let fd = new FormData(); //通过form数据格式来传
      fd.append("file", f.file);
      // console.log(fd.get('file'));
      axios.post('/uploadConsoleExcel', fd, {'Content-Type': 'multipart/form-data'}).then(res => {
        console.log(res);
        if (res.data.success == true) {
          axios.post('/createMissionFile', {
            "fileName": res.data.message,
            "url": res.data.fileAddress,
            "size": res.data.size,
            "userId": window.localStorage.getItem("id"),
            "missionId": this.missionsDetail.number,
            "enterpriseId": window.localStorage.getItem("enterprise_id")
          }).then(res => {
            if (res.data == 1) {
              this.$notify({
                title: '成功',
                message: '上传成功',
                type: 'success'
              });
            } else {
              this.$notify.error({
                title: '失败',
                message: '上传失败',
              });
            }
          })
        }
      })
    },
  },
  created() {
    setTimeout(() => {
      this.$parent.$parent.ToClose();
    }, 100)
    this.$loading(true)
    this.tableData = []
    axios.post('/getConsoleProjectMessage',
      {"id": window.localStorage.getItem("enterprise_id")}).then(res => {
      // console.log(res.data)
      this.totalData = res.data
      this.tableData = this.totalData.slice(0, 10)
      console.log(res.data.length)
      this.totalNum = res.data.length
      // this.totalNum = res.data
    });
    console.log(this.totalNum)
    this.$loading().close()
  }
}
</script>

<style scoped>

</style>
